package com.example.interview.example.trafficLightSystem;

/**
 *   1.用for循环创建出代表12条路线的对象。
 *   2.接着创建出LampController对象。
 */
public class MainTraffic {
    public static void main(String[] args) {
        /*产生12个方向的路线*/
        String[] directions = new String[]{"S2N", "S2W", "E2W", "E2S", "N2S", "N2E", "W2E", "W2N", "S2E", "E2N", "N2W", "W2S"};
        for (int i = 0; i < directions.length; i++) {
            new Road(directions[i]); // 模拟车辆不断随机上路 + //每隔一秒检查对应的灯是否为绿，是则放行一辆车
        }
        /*产生整个交通灯系统*/
        new LampController();
    }
}
